<template>
  <div id="messageCentent">
    <!-- <div class="title">
      <img src="../../assets/img/zhuangshi.png" alt />
      <h4>消息中心</h4>
    </div> -->
    <ul v-loading="loading"
    element-loading-text="拼命加载中"  element-loading-spinner="el-icon-loading" class="messageCenter-list">
      <li v-for="(v,i) in list" :key="i" >
        <div v-if='$route.query.id == v.catId'>
          <img src="../../assets/img/xiaoxi.png" alt />
          <span>{{v.catName}}</span>

          <el-tooltip effect="dark" :content="v.title" placement="top">
            <span>{{v.title}}</span>
          </el-tooltip>
        </div>
        <span v-if='$route.query.id == v.catId'>{{v.helpContentList[0].contentDesc}}}</span>
      </li>
    </ul>
  </div>
</template>
<script>
import { getCatAndContentList } from '../../api/api'
export default {
  name: "messageCenter",
  data() {
    return {
      list:[],
      loading:false
    };
  },
  created(){
    this.getList();
  },
  methods: {
    getList(){
      this.loading = true
      getCatAndContentList().then(res=>{
        this.loading = false
        this.list = res.data.data
      })
    }
  }
};
</script>
<style lang='less' scope>

// ----------------------
#messageCentent {
  min-height: 600px;
  background-color: #fff;
  padding: 15px;
  .title {
  position: relative;
  > img {
    position: absolute;
    top: 4px;
  }
  > h4 {
    margin-left: 50px;
  }
}
  .messageCenter-list {
    margin-top: 30px;
    > li {
      > div {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        > span:nth-of-type(1) {
          color: #334d50;
          font-size: 13px;
          margin: 0 30px;
        }
        > span:nth-of-type(2) {
          color: #a1b1b0;
          font-size: 14px;
          display: inline-block;
          max-width: 400px;
          white-space: nowrap;
          text-overflow: ellipsis;
          overflow: hidden;
        }
      }
      > span {
        display: block;
        margin-top: 10px;
        text-indent: 2rem;
        color: #a1b1b0;
        font-size: 14px;
      }
    }
  }
}
</style>